//package com.thinksns.sociax.t4.android.event;
//
//import android.content.Intent;
//import android.graphics.drawable.ColorDrawable;
//import android.os.Bundle;
//import android.os.Handler;
//import android.os.Message;
//import android.support.v7.widget.LinearLayoutManager;
//import android.support.v7.widget.RecyclerView;
//import android.text.TextUtils;
//import android.view.Gravity;
//import android.view.LayoutInflater;
//import android.view.View;
//import android.view.ViewStub;
//import android.webkit.WebView;
//import android.widget.FrameLayout;
//import android.widget.ImageView;
//import android.widget.LinearLayout;
//import android.widget.ListView;
//import android.widget.PopupWindow;
//import android.widget.RelativeLayout;
//import android.widget.TextView;
//
//import com.bumptech.glide.DrawableTypeRequest;
//import com.bumptech.glide.Glide;
//import com.bumptech.glide.load.engine.DiskCacheStrategy;
//import com.scwang.smartrefresh.layout.SmartRefreshLayout;
//import com.scwang.smartrefresh.layout.api.RefreshLayout;
//import com.scwang.smartrefresh.layout.listener.OnLoadmoreListener;
//import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
//import com.thinksns.sociax.android.R;
//import com.thinksns.sociax.component.CustomTitle;
//import com.thinksns.sociax.component.LeftAndRightTitle;
//import com.thinksns.sociax.component.TimeUtils;
//import com.thinksns.sociax.constant.EventConstant;
//import com.thinksns.sociax.t4.adapter.AdapterEventBigImageList;
//import com.thinksns.sociax.t4.adapter.AdapterEventComment;
//import com.thinksns.sociax.t4.adapter.AdapterEventDetailMemberList;
//import com.thinksns.sociax.t4.android.Thinksns;
//import com.thinksns.sociax.t4.android.ThinksnsAbscractActivity;
//import com.thinksns.sociax.t4.android.popupwindow.PopupWindowEventMore;
//import com.thinksns.sociax.t4.android.popupwindow.PopupWindowShowNotify;
//import com.thinksns.sociax.t4.android.video.ActivityIjkPlayer;
//import com.thinksns.sociax.t4.android.video.ToastUtils;
//import com.thinksns.sociax.t4.component.SmallDialog;
//import com.thinksns.sociax.t4.model.ModelEventDetail;
//import com.thinksns.sociax.t4.model.ModelEventNotifyComment;
//import com.thinksns.sociax.t4.model.ModelUser;
//import com.thinksns.sociax.t4.unit.MyBlurTransfornation;
//import com.thinksns.sociax.thinksnsbase.network.ApiHttpClient;
//import com.thinksns.sociax.thinksnsbase.utils.UnitSociax;
//import com.thinksns.tschat.map.ActivityLocation;
//
//import org.greenrobot.eventbus.EventBus;
//import org.greenrobot.eventbus.Subscribe;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import static com.bumptech.glide.Glide.with;
//
//public class EventDetailActivity extends ThinksnsAbscractActivity implements View.OnClickListener, OnRefreshListener, OnLoadmoreListener {
//
////    protected PullToRefreshListView refreshView;
//    protected ListView mListView;
//    protected View headerView;
//    protected SmartRefreshLayout smartRefreshLayout;
//
//    private ImageView ivFace; //图标
//    private TextView tvLabel; //名称
//    private TextView tvInitiator; //发起人
//    private TextView tvPosition; //位置
//    private TextView tvAddress; //详细地址
//    private RelativeLayout rlPlace; //位置
//    private TextView tvTime; //时间
//    private LinearLayout llTime;
//    private TextView tvPrice; //价格
//    private RelativeLayout rlPrice;
//    private TextView tvTopic;
//    private LinearLayout llTopic;
//    private WebView tvDesc;
//    private TextView tvDescShow;
//    private TextView tvMembers;
//    private RelativeLayout rlMembers;
//    private RecyclerView rvMembers;
//    private TextView tvComments;
//    private RelativeLayout rlComments;
//    private TextView tvApply;
//    private ImageView rl_detail_bg;
//    private TextView tv_detail_price_label;
//
//    private RelativeLayout btn_detail_attention;
//    private RelativeLayout btn_detail_comment;
//    private TextView tv_detail_comment_count;
//    private TextView tv_detail_attention;
//    private SmallDialog dialog;
//    private ViewStub stub_image_group, //图片
//            stub_media; //视频
//    private RecyclerView rv_group_list;
//    private ImageView img_vedio;
//
//    protected String eid;
//    protected boolean actAlive = true; //标志act是否已经onDestroy();
//    protected EventDetailPresenter mPresenter;
//    protected AdapterEventDetailMemberList memberAdapter;
//    protected AdapterEventComment commentAdapter;
//    protected AdapterEventBigImageList imgAdapter;
//    protected int mCurrentPage = 1;
//    private ModelEventDetail eventDetail;
//
//    private static final int GET_DETAIL_OK = 401;
//    private static final int GET_REPLY_OK = 402;
//    private PopupWindow popupWindowShowNotify;
//    private PopupWindowEventMore pup;
//    private com.thinksns.sociax.t4.unit.UnitSociax mUnitSociax;
//
//    @Override
//    public String getTitleCenter() {
//        return "活动详情";
//    }
//
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        initIntentData();
//        findViews();
//        initListener();
//        initData();
//        EventBus.getDefault().register(this);
//    }
//
//    private void initIntentData() {
//        Bundle bundle = getIntent().getExtras();
//        if (bundle == null) {
//            throw new AssertionError("intent no data!");
//        } else {
//            eid = bundle.getInt("eid") + "";
//        }
//    }
//
//    private void findViews() {
//        tvApply = (TextView) findViewById(R.id.tv_detail_apply);
//        smartRefreshLayout = (SmartRefreshLayout) findViewById(R.id.smart_refresh_layout);
//        mListView = (ListView) findViewById(R.id.pull_refresh_list);
//        mPresenter = new EventDetailPresenter();
//        dialog = new SmallDialog(this, "操作中...");
//        pup = new PopupWindowEventMore(this);
//        mUnitSociax = new com.thinksns.sociax.t4.unit.UnitSociax(this);
//        initListViewAttr();
//        initHeader(); //初始化头部
//
//        memberAdapter = new AdapterEventDetailMemberList(this, null);
//        rvMembers.setAdapter(memberAdapter);
//        rvMembers.setLayoutManager(new MyLinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, false));
//
//        mListView.addHeaderView(headerView, null, false);
//        commentAdapter = new AdapterEventComment(this, null);
//        mListView.setAdapter(commentAdapter);
//        smartRefreshLayout.setEnableLoadmore(false);
//    }
//
//    protected void initListViewAttr() {
//        mListView.setDivider(new ColorDrawable(0x72cccccc));
//        mListView.setDividerHeight(UnitSociax.dip2px(this, 0.2f));
//        mListView.setSelector(new ColorDrawable(getResources().getColor(android.R.color.transparent)));
//    }
//
//    private void initListener() {
//        smartRefreshLayout.setOnRefreshListener(this);
//        smartRefreshLayout.setOnLoadmoreListener(this);
//        tvApply.setOnClickListener(this);
//        btn_detail_attention.setOnClickListener(this);
//        btn_detail_comment.setOnClickListener(this);
//        rlComments.setOnClickListener(this);
//        rlPlace.setOnClickListener(this);
//        rlPrice.setOnClickListener(this);
//        pup.setStarClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                btn_detail_attention.performClick();
//            }
//        });
//        rlMembers.setOnClickListener(this);
//    }
//
//    private void initData() {
//        smartRefreshLayout.autoRefresh();
//    }
//
//    protected void doRefresh() {
//        mPresenter.getEventDetail();
//        mCurrentPage = 1;
//    }
//
//    protected void doLoadComments() {
//        mCurrentPage++;
//        mPresenter.getEventReply(mCurrentPage);
//    }
//
//    private void initHeader() {
//        headerView = LayoutInflater.from(this).inflate(R.layout.header_event_detail, null);
//        this.rl_detail_bg = (ImageView) headerView.findViewById(R.id.rl_detail_bg);
//        this.btn_detail_attention = (RelativeLayout) headerView.findViewById(R.id.btn_detail_attention);
//        this.btn_detail_comment = (RelativeLayout) headerView.findViewById(R.id.btn_detail_comment);
//        this.tv_detail_comment_count = (TextView) headerView.findViewById(R.id.tv_detail_comment_count);
//        this.tv_detail_attention = (TextView) headerView.findViewById(R.id.tv_detail_attention);
//        this.rlComments = (RelativeLayout) headerView.findViewById(R.id.rl_detail_comments);
//        this.tvComments = (TextView) headerView.findViewById(R.id.tv_detail_comments);
//        this.rvMembers = (RecyclerView) headerView.findViewById(R.id.rv_detail_members);
//        this.rlMembers = (RelativeLayout) headerView.findViewById(R.id.rl_detail_members);
//        this.tvMembers = (TextView) headerView.findViewById(R.id.tv_detail_members);
//        this.tvDescShow = (TextView) headerView.findViewById(R.id.tv_detail_desc_show);
//        this.tvDesc = (WebView) headerView.findViewById(R.id.tv_detail_desc);
//        this.llTopic = (LinearLayout) headerView.findViewById(R.id.ll_detail_topic);
//        this.tvTopic = (TextView) headerView.findViewById(R.id.tv_detail_topic);
//        this.rlPrice = (RelativeLayout) headerView.findViewById(R.id.rl_detail_price);
//        this.tvPrice = (TextView) headerView.findViewById(R.id.tv_detail_price);
//        this.llTime = (LinearLayout) headerView.findViewById(R.id.ll_detail_time);
//        this.tvTime = (TextView) headerView.findViewById(R.id.tv_detail_time);
//        this.rlPlace = (RelativeLayout) headerView.findViewById(R.id.rl_detail_place);
//        this.tvAddress = (TextView) headerView.findViewById(R.id.tv_detail_address);
//        this.tvPosition = (TextView) headerView.findViewById(R.id.tv_detail_position);
//        this.tvInitiator = (TextView) headerView.findViewById(R.id.tv_detail_initiator);
//        this.tvLabel = (TextView) headerView.findViewById(R.id.tv_detail_label);
//        this.ivFace = (ImageView) headerView.findViewById(R.id.iv_detail_face);
//        this.tv_detail_price_label = (TextView) headerView.findViewById(R.id.tv_detail_price_label);
//
//        this.stub_image_group = (ViewStub) headerView.findViewById(R.id.stub_image_group);
//        this.stub_media = (ViewStub) headerView.findViewById(R.id.stub_media);
//
//    }
//
//    @Override
//    protected CustomTitle setCustomTitle() {
//        return new LeftAndRightTitle(this, R.drawable.icon_back, R.drawable.icon_share_more);
//    }
//
//    @Override
//    public View.OnClickListener getRightListener() {
//        return new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                pup.setEventDetial(eventDetail);
//                pup.setDeleteListener(new View.OnClickListener() {
//                    @Override
//                    public void onClick(View v) {
//                        mPresenter.delEvent();
//                    }
//                });
//                pup.show(v);
//            }
//        };
//    }
//
//    @Override
//    protected int getLayoutId() {
//        return R.layout.activity_event_detail;
//    }
//
//    @Override
//    public void onClick(View v) {
//        switch (v.getId()) {
//            case R.id.tv_detail_apply: //报名
//
//                if (eventDetail.getStime() * 1000 > System.currentTimeMillis()) {
//                    ToastUtils.showToast("活动还未开始,敬请期待");
//                    return;
//                }
//                Intent intent = new Intent(this, EventApplyActivity.class);
//                intent.putExtra("eid", eid);
//                startActivityForResult(intent, 0);
//                break;
//            case R.id.btn_detail_attention: //关注
//                if (eventDetail != null) {
//                    dialog.show();
//                    mPresenter.starAct(eventDetail.getStar());
//                }
//                break;
//            case R.id.btn_detail_comment: //点击评论()
//            case R.id.rl_detail_comments: //点击全部评论一栏
//                //跳转至全部评论
//                Intent intent1 = new Intent(this, EventDetailCommentActivity.class);
//                intent1.putExtra("eid", eid);
//                startActivity(intent1);
//                break;
//            case R.id.rl_detail_place: //跳转位置 地图查看
//                Intent intent2 = new Intent(this, ActivityLocation.class);
//                intent2.putExtra("latitude", eventDetail.getLatitude());
//                intent2.putExtra("longitude", eventDetail.getLongitude());
//                intent2.putExtra("address", eventDetail.getLocation());
//                intent2.putExtra("city", eventDetail.getCity());
//                intent2.putExtra("from_event_detail", true);
//                startActivity(intent2);
//                break;
//            case R.id.rl_detail_price:
//                if (!TextUtils.isEmpty(eventDetail.getTips())) {
//                    popupWindowShowNotify = new PopupWindowShowNotify
//                            .Builder(this)
//                            .setTitle("费用详情")
//                            .setContent(eventDetail.getTips())
//                            .setOk("确定", new View.OnClickListener() {
//                                @Override
//                                public void onClick(View v) {
//                                    popupWindowShowNotify.dismiss();
//                                }
//                            })
//                            .build();
//                    popupWindowShowNotify.showAtLocation(getWindow().getDecorView(), Gravity.CENTER, 0, 0);
//                }
//                break;
//            case R.id.rl_detail_members:
//                Intent intent3 = new Intent(this, EventDetailAllMemberActivity.class);
//                intent3.putExtra("eid", eid);
//                startActivity(intent3);
//                break;
//        }
//    }
//
//    @Override
//    protected void onDestroy() {
//        actAlive = false;
//        EventBus.getDefault().unregister(this);
//        super.onDestroy();
//    }
//
//    @Override
//    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//        super.onActivityResult(requestCode, resultCode, data);
//        if (resultCode == EventApplyActivity.RESULT_APPLY_OK) { //重置报名状态
//            /*报名不需要审核直接设置 8.11.2017*/
//            if (EventConstant.ENROLLMENT_NOT_AUDIT.equals(eventDetail.getAudit())){
//                eventDetail.setEnrollment_status(EventConstant.ENROLLMENT_STATUS_APPLIED);
//                setApplyState(eventDetail);
//                doRefresh();
//            }else if(EventConstant.ENROLLMENT_AUDIT.equals(eventDetail.getAudit())){
//                eventDetail.setEnrollment_status(EventConstant.ENROLLMENT_STATUS_AUDITING);
//                setApplyState(eventDetail);
//            }
//
//        }
//    }
//
//    private Handler handler = new Handler() {
//        @Override
//        public void handleMessage(Message msg) {
//            switch (msg.what) {
//                case GET_DETAIL_OK:
//                    mPresenter.getEventReply(mCurrentPage);
//                    eventDetail = (ModelEventDetail) msg.obj;
//                    appendHeaderContent((ModelEventDetail) msg.obj);
//                    break;
//                case GET_REPLY_OK:
//                    List<ModelEventNotifyComment> comments = ((ModelExpandComment) msg.obj).getComment();
//                    if (comments.size() > 5) { //大于5条 只取5条
//                        commentAdapter.setHasData();
//                        commentAdapter.resetData(new ArrayList<>(comments.subList(0, 5)));
//                    } else if (comments.size() > 0) { //总数
//                        commentAdapter.setHasData();
//                        commentAdapter.resetData(comments);
//                    } else {
//                        commentAdapter.setNoData();
//                    }
//                    tv_detail_comment_count.setText("评论(" + ((ModelExpandComment) msg.obj).getCommentCount() + ")");
//                    smartRefreshLayout.finishRefresh();
//                    smartRefreshLayout.finishLoadmore();
//                    break;
//            }
//        }
//    };
//
//    private void appendHeaderContent(ModelEventDetail detail) {
//        tvLabel.setText(detail.getName());
//
//        //设置图片
//        DrawableTypeRequest<String> result = Glide.with(this)
//                .load(detail.getImage());
//        result.into(ivFace);
//        //设置模糊图
//        result.bitmapTransform(new MyBlurTransfornation(this, 5, 1, 0.6f)).into(rl_detail_bg);
//
//        tvInitiator.setText(detail.getApplyUser().getUserName());
//        tvPosition.setText((detail.getCity() == null ? "" : detail.getCity()) +
//                " " + (detail.getArea() == null ? "" : detail.getArea()));
//        tvAddress.setText(detail.getLocation());
//        tvTime.setText(TimeUtils.getTimeTamp(detail.getStime(), detail.getEtime()));
//        tvPrice.setText(detail.getPrice() + "元");
//        if (TextUtils.isEmpty(detail.getTips())) { //没有价格
//            tv_detail_price_label.setVisibility(View.GONE);
//        }
//        tvTopic.setText(detail.getCate());
//        /*报名人增加为 null 判断，避免无报名人崩溃 8.11.2017*/
//        List<ModelUser> joinUsers = detail.getJoinUsers();
//        if (joinUsers == null) joinUsers = new ArrayList<>();
//        tvMembers.setText(joinUsers.size() + "人");
//
//        setWebViewContent(detail);
//        setAttentionState(detail.getStar());
//        setApplyState(detail);
//        memberAdapter.refreshAll(joinUsers);
//    }
//
//    public void setWebViewContent(final ModelEventDetail detail) {
//        String content = "<p>" + detail.getName() + "</p>" + detail.getContent();
//
//        //增加标签属性 style 控制图片适应屏幕宽
//        content = content.replace("<img", "<img style='max-width:100%;height:auto;'");
//        mUnitSociax.appendWebViewContent(tvDesc, content, null);
////        tvDesc.loadDataWithBaseURL(null, content
////                , "text/html", "utf-8", null);
//
//        //图片 拼在webview后面
//        if (detail.getImageList() != null) {
//            if (stub_image_group.getParent() != null) {
//                stub_image_group.inflate();
//                rv_group_list = (RecyclerView) headerView.findViewById(R.id.rv_image_group);
//                imgAdapter = new AdapterEventBigImageList(this, null);
//                rv_group_list.setAdapter(imgAdapter);
//                rv_group_list.setLayoutManager(new MyLinearLayoutManager(this, LinearLayoutManager.VERTICAL, false, false));
//            }
//            rv_group_list.postDelayed(new Runnable() {
//                @Override
//                public void run() {
//                    imgAdapter.resetData(detail.getImageList());
//                }
//            }, 300);
//
//        }
//
//        //视频拼在后面
//        if (detail.getVideoList() != null) {
//            if (stub_media.getParent() != null) {
//                final ModelEventDetail.ModelVideo video = detail.getVideoList().get(0);
//                FrameLayout ll_media = (FrameLayout) stub_media.inflate();
//                img_vedio = (ImageView) findViewById(R.id.img_vedio);
//
//                int width = getResources().getDisplayMetrics().widthPixels;
//                int height = width * 9 / 16; //宽高比 16:9
//                FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) img_vedio.getLayoutParams();
//                layoutParams.width = width;
//                layoutParams.height = height;
//                img_vedio.setLayoutParams(layoutParams);
//
//                //preview_img
//                with(this)
//                        .load(video.getImgurl())
//                        .diskCacheStrategy(DiskCacheStrategy.ALL)
//                        .placeholder(R.drawable.image602x338)
//                        .into(img_vedio);
//
//                ll_media.setOnClickListener(new View.OnClickListener() {
//                    @Override
//                    public void onClick(View v) { //视频全部来自拍摄，不存在来自网络
//                        Intent intent = new Intent(v.getContext(), ActivityIjkPlayer.class);
//                        intent.putExtra("url", video.getUrl());
//                        intent.putExtra("preview_url", video.getImgurl());
//                        startActivity(intent);
//                    }
//                });
//            }
//        }
//    }
//
//    protected void setAttentionState(boolean isStar) {
//        tv_detail_attention.setText(isStar ? "已关注" : "关注活动");
//    }
//
//    public void setApplyState(ModelEventDetail detail) {
//        /*修改报名状态设置，增加审核中状态 8.11.2017*/
//        tvApply.setEnabled(false);
//        tvApply.setBackgroundResource(R.drawable.event_detail_button_gray_bg);
//        if (detail.getEtime() * 1000 < System.currentTimeMillis()) {
//            /*报名已结束*/
//            tvApply.setText(R.string.event_already_end);
//        } else if (EventConstant.ENROLLMENT_STATUS_APPLIED == detail.getEnrollment_status()) {
//            /*已报名*/
//            tvApply.setText(R.string.event_already_applied);
//        }else if(EventConstant.ENROLLMENT_STATUS_AUDITING == detail.getEnrollment_status()){
//            /*审核中*/
//            tvApply.setText(R.string.event_apply_auditing);
//        }else if(TextUtils.isEmpty(detail.getManNumber())||  "0".equals(detail.getManNumber())){
//            /*活动人数 ==0， 表示不限制活动名额*/
//            tvApply.setEnabled(true);
//            tvApply.setText(R.string.event_apply_now);
//            tvApply.setBackgroundResource(R.drawable.event_detail_button_bg);
//        }else if(TextUtils.isEmpty(detail.getRemainder()) || detail.getRemainder().equals("0")){
//            /*剩余可报名人数为0*/
//            tvApply.setEnabled(false);
//            tvApply.setText(R.string.event_apply_full);
//        }else{
//            // 报名剩余人数
//            tvApply.setEnabled(true);
//            tvApply.setText(String.format(getString(R.string.event_format_apply_remain), detail.getRemainder()));
//            tvApply.setBackgroundResource(R.drawable.event_detail_button_bg);
//        }
//    }
//
//    @Override
//    public void onRefresh(RefreshLayout refreshlayout) {
//        doRefresh();
//    }
//
//    //最多展示5条评论，所以就没有加载跟多了
//    @Override
//    public void onLoadmore(RefreshLayout refreshlayout) {
////        doLoadComments();
//    }
//
//    private class EventDetailPresenter {
//        public void getEventDetail() {
//            ((Thinksns) getApplicationContext()).getApiEvent().getInfo(eid, new ApiHttpClient.HttpResponseListener() {
//                @Override
//                public void onSuccess(Object result) {
//                    if (actAlive) {
//                        handler.sendMessage(handler.obtainMessage(GET_DETAIL_OK, result));
//                    }
//                }
//
//                @Override
//                public void onError(Object result) {
//                    smartRefreshLayout.finishRefresh();
//                    ToastUtils.showToast((String) result);
//                }
//            });
//        }
//
//        public void getEventReply(int page) {
//            ((Thinksns) getApplicationContext()).getApiEvent().getMyComment(eid, "0", true, new ApiHttpClient.HttpResponseListener() {
//                @Override
//                public void onSuccess(Object result) {
//                    if (actAlive) {
//                        handler.sendMessage(handler.obtainMessage(GET_REPLY_OK, result));
//                    }
//                }
//
//                @Override
//                public void onError(Object result) {
//                    if (actAlive) {
//                        smartRefreshLayout.finishRefresh();
//                        smartRefreshLayout.finishLoadmore();
//                        if (!((String) result).equals(getString(R.string.load_fail))) {
//                            commentAdapter.setNoData();
//                            return;
//                        }
//                        ToastUtils.showToast((String) result);
//                    }
//                }
//            });
//        }
//
//        public void starAct(boolean isStar) {
//            if (isStar) {
//                ((Thinksns) getApplicationContext()).getApiEvent().unStar(eid, startListener);
//            } else {
//                ((Thinksns) getApplicationContext()).getApiEvent().star(eid, startListener);
//            }
//        }
//
//        public void delEvent() {
//            ((Thinksns) getApplicationContext()).getApiEvent().delEvent(eid, new ApiHttpClient.HttpResponseListener() {
//                @Override
//                public void onSuccess(Object result) {
//                    ToastUtils.showToast("删除成功");
//                    if (actAlive && (Boolean) result) {
//                        Intent intent = new Intent(EventDetailActivity.this, EventActivity.class);
//                        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
//                        startActivity(intent);
//                    }
//                }
//
//                @Override
//                public void onError(Object result) {
//                    ToastUtils.showToast((String) result);
//                }
//            });
//        }
//
//        ApiHttpClient.HttpResponseListener startListener = new ApiHttpClient.HttpResponseListener() {
//            @Override
//            public void onSuccess(Object result) {
//                if (result instanceof Boolean) {
//                    eventDetail.setStar((Boolean) result);
//                    setAttentionState((Boolean) result);
//                    if (pup != null) {
//                        pup.showFavStatus((Boolean) result);
//                    }
//                }
//                dialog.dismiss();
//            }
//
//            @Override
//            public void onError(Object result) {
//                dialog.dismiss();
//                ToastUtils.showToast((String) result);
//            }
//        };
//
//    }
//
//    @Subscribe
//    public void refreshComment(ModelEventNotifyComment comment){
//        doRefresh();
//    }
//}
